<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>index</title>
<script type="text/javascript">
	var base = "${base}/";
	var count = 0;
</script>
<!--框架必需-->
<script type="text/javascript" src="${base}/scripts/plugins/jquery-1.7.1.js"></script>
<script type="text/javascript" src="${base}/scripts/framework.js"></script>
<link href="${base}/css/import_basic.css" rel="stylesheet" type="text/css"/>
<link href="${base}/css/sky/style.css" rel="stylesheet" type="text/css" />

</head>
<body>
<div style="width:auto">
<table class="tableStyle cusTreeTable" ohterClose="false" useColor="false" useHover="false" useClick="false" trClick="true">
	<tr>
		<th width="30"><input type="checkbox"/></th>
		<th>消息标题</th>
		<th>发信人</th>
		<th>发信时间</th>
	</tr>
	<#if (smsList??) && (smsList?size>0)>
	<#list smsList as sms>
	<tr onclick="changeReadStatus(${(sms.id)!0}, ${(sms.isReaded)?string(1, 0)})">
		<td><input type="checkbox"/></td>
		<td>${(sms.title)!''}</td>
		<td>${(sms.addresserId)!''}</td>
		<td>${(sms.createDate?string('yyyy-MM-dd HH:mm:ss'))}</td>
	</tr>
	<tr>
		<td colspan="4">
			<table class="tableStyle" useHover="false" useClick="false">
				<tr>
					<td>
					${(sms.content)!''}
					</td>
				</tr>
			</table>
		</td>
	</tr>
	</#list>
	<#else>
		<tr>
			<td colspan="4">暂无消息记录</td>
		</tr>
	</#if>
</table>
</div>
</body>
</html>
<script type="text/javascript">
function changeReadStatus(smsId, readStatus) {
	count ++;
	if (readStatus != 1 && count == 1) {
		$.post("${base}/admin/sms/updateToIsReaded.action", {"sms.id": smsId}, function(){});
	}
}
</script>